<!DOCTYPE html>
<html lang="<?php echo $lang; ?>">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo isset($t['siteTitle']) ? $t['siteTitle'] : '王者荣耀 - 官方网站'; ?></title>
    <meta name="description" content="<?php echo isset($t['metaDescription']) ? $t['metaDescription'] : '5v5英雄公平对战手游，国民MOBA手游大作'; ?>">
    <!-- 引入外部资源 -->
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    
    <!-- Tailwind 配置 - 小清新风格 -->
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#F26B8A', // 清新粉
                        secondary: '#5BC8AF', // 薄荷绿
                        accent: '#F7DC6F', // 柔和黄
                        light: '#F8FCFC', // 浅色背景
                        dark: '#34495E', // 深色文本
                    },
                    fontFamily: {
                        sans: ['Nunito', 'sans-serif'],
                        display: ['"Quicksand"', 'sans-serif']
                    },
                }
            }
        }
    </script>
    
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .text-shadow-sm {
                text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
            }
            .transition-custom {
                transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
            }
            .card-hover {
                transition: transform 0.3s ease, box-shadow 0.3s ease;
            }
            .card-hover:hover {
                transform: translateY(-5px);
                box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
            }
            .bg-blur {
                backdrop-filter: blur(8px);
            }
        }
    </style>
    
    <!-- 小清新风格字体 -->
    <link href="https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;600;700&family=Quicksand:wght@500;600;700&display=swap" rel="stylesheet">
</head>
<body class="bg-light text-dark font-sans">
    <!-- 导航栏 -->
    <header id="navbar" class="fixed w-full z-50 transition-all duration-300 bg-white/90 bg-blur shadow-sm">
        <div class="container mx-auto px-4 py-3 flex items-center justify-between">
            <!-- 网站Logo -->
            <a href="#" class="flex items-center">
                <div class="w-10 h-10 rounded-full bg-primary/10 flex items-center justify-center mr-3">
                    <span class="font-display text-primary text-xl font-bold">王</span>
                </div>
                <h1 class="text-2xl font-display text-dark">王者荣耀</h1>
            </a>
            
            <!-- 桌面导航菜单 -->
            <?php if(isset($t['nav']) && !empty($t['nav'])){?>
            <nav class="hidden md:flex items-center space-x-8">
                <?php foreach ($t['nav'] as $item): ?>
                    <a href="<?php echo isset($item['link']) ? $item['link'] : '#'; ?>" class="text-dark hover:text-primary transition-colors duration-300 <?php echo isset($item['isCta']) ? 'bg-primary hover:bg-primary/90 text-white px-5 py-2 rounded-full shadow-md' : ''; ?>">
                        <?php echo isset($item['name']) ? $item['name'] : ''; ?>
                    </a>
                <?php endforeach; ?>
            </nav>
            <?php }?>
            
            <!-- 语言选择器 -->
            <?php if(isset($t['lang']) && !empty($t['lang'])){?>
            <div class="hidden md:block relative">
                <button id="langToggle" class="flex items-center text-dark hover:text-primary transition-colors">
                    <i class="fa fa-globe mr-2"></i>
                    <span><?php echo isset($t['lang'][$lang]) ? $t['lang'][$lang] : ''; ?></span>
                    <i class="fa fa-chevron-down ml-2 text-xs"></i>
                </button>
                <div id="langDropdown" class="absolute right-0 mt-2 w-36 bg-white border border-gray-100 rounded-lg shadow-lg hidden z-50">
                    <?php foreach ($availableLangs as $l): ?>
                        <a href="?lang=<?php echo $l; ?>" class="block px-4 py-2 hover:bg-primary/10 transition-colors <?php echo $l == $lang ? 'bg-primary/10' : ''; ?>">
                            <?php echo isset($t['lang'][$l]) ? $t['lang'][$l] : ''; ?>
                        </a>
                    <?php endforeach; ?>
                </div>
            </div>
            <?php }?>
            
            <!-- 移动端菜单按钮 -->
            <button id="mobileMenuBtn" class="md:hidden text-dark text-2xl">
                <i class="fa fa-bars"></i>
            </button>
        </div>
        
        <!-- 移动端导航菜单 -->
        <div id="mobileMenu" class="md:hidden bg-white fixed inset-0 z-50 transform translate-x-full transition-transform duration-300 shadow-xl">
            <div class="flex justify-end p-4">
                <button id="closeMenuBtn" class="text-dark text-2xl">
                    <i class="fa fa-times"></i>
                </button>
            </div>
            <?php if(isset($t['nav']) && !empty($t['nav'])){?>
            <nav class="flex flex-col items-center space-y-6 mt-10">
                <?php foreach ($t['nav'] as $item): ?>
                    <a href="<?php echo isset($item['link']) ? $item['link'] : '#'; ?>" class="text-dark text-xl hover:text-primary transition-colors duration-300 <?php echo isset($item['isCta']) ? 'bg-primary hover:bg-primary/90 text-white px-8 py-3 rounded-full shadow-md' : ''; ?>">
                        <?php echo isset($item['name']) ? $item['name'] : ''; ?>
                    </a>
                <?php endforeach; ?>
                
                <!-- 移动端语言选择 -->
                <?php if(isset($t['lang']) && !empty($t['lang'])){?>
                <div class="mt-6 pt-6 border-t border-gray-100 w-3/4">
                    <p class="text-center mb-4 text-dark/60"><?php echo isset($t['lang'][$lang]) ? $t['lang'][$lang] : ''; ?></p>
                    <div class="grid grid-cols-2 gap-2">
                        <?php foreach ($availableLangs as $l): ?>
                            <a href="?lang=<?php echo $l; ?>" class="text-center py-2 border border-gray-100 rounded-lg hover:bg-primary/10 transition-colors">
                                <?php echo isset($t['lang'][$l]) ? $t['lang'][$l] : ''; ?>
                            </a>
                        <?php endforeach; ?>
                    </div>
                </div>
                <?php }?>
            </nav>
            <?php }?>
        </div>
    </header>

    <!-- 英雄区域/Hero Section -->
    <?php if(isset($t['hero']) && !empty($t['hero'])){?>
    <section class="relative pt-24 pb-16 md:pt-32 md:pb-24 overflow-hidden">
        <!-- 背景装饰 -->
        <div class="absolute top-0 right-0 w-1/2 h-full bg-secondary/5 -skew-x-12 transform origin-top-right"></div>
        <div class="absolute -top-20 -left-20 w-64 h-64 bg-primary/10 rounded-full"></div>
        <div class="absolute bottom-10 right-10 w-40 h-40 bg-accent/10 rounded-full"></div>
        
        <!-- 内容 -->
        <div class="container mx-auto px-4 relative z-10">
            <div class="grid grid-cols-1 lg:grid-cols-2 gap-12 items-center">
                <div class="order-2 lg:order-1">
                    <?php if(isset($t['hero']['version'])){?>
                    <div class="inline-block px-4 py-1.5 bg-primary/10 text-primary rounded-full text-sm font-medium mb-6">
                        <?php echo $t['hero']['version']; ?>
                    </div>
                    <?php }?>
                    
                    <?php if(isset($t['hero']['title'])){?>
                    <h1 class="text-[clamp(2rem,5vw,3.5rem)] font-display font-bold leading-tight mb-6 text-dark">
                        <?php echo $t['hero']['title']; ?>
                    </h1>
                    <?php }?>
                    
                    <?php if(isset($t['hero']['subtitle'])){?>
                    <p class="text-lg text-dark/70 mb-8 max-w-lg">
                        <?php echo $t['hero']['subtitle']; ?>
                    </p>
                    <?php }?>
                    
                    <div class="flex flex-wrap gap-4">
                        <?php if(isset($t['hero']['cta1'])){?>
                        <a href="<?php echo isset($t['hero']['cta1']['link']) ? $t['hero']['cta1']['link'] : '#'; ?>" class="px-8 py-3 bg-primary hover:bg-primary/90 text-white rounded-full font-medium transition-all duration-300 shadow-md hover:shadow-lg">
                            <?php echo isset($t['hero']['cta1']['text']) ? $t['hero']['cta1']['text'] : ''; ?>
                        </a>
                        <?php }?>
                        
                        <?php if(isset($t['hero']['cta2'])){?>
                        <a href="<?php echo isset($t['hero']['cta2']['link']) ? $t['hero']['cta2']['link'] : '#'; ?>" class="px-8 py-3 bg-white border border-gray-200 text-dark hover:bg-gray-50 rounded-full font-medium transition-all duration-300 flex items-center shadow-sm">
                            <span><?php echo isset($t['hero']['cta2']['text']) ? $t['hero']['cta2']['text'] : ''; ?></span>
                            <i class="fa <?php echo isset($t['hero']['cta2']['icon']) ? $t['hero']['cta2']['icon'] : ''; ?> ml-2 text-primary"></i>
                        </a>
                        <?php }?>
                    </div>
                </div>
                
                <div class="order-1 lg:order-2 relative">
                    <div class="relative z-10 rounded-2xl overflow-hidden shadow-xl transform rotate-2 transition-transform hover:rotate-0 duration-500">
                        <img src="https://picsum.photos/id/100/600/700" alt="王者荣耀游戏场景" class="w-full h-auto">
                    </div>
                    <div class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-full h-full bg-primary/20 rounded-2xl -z-10"></div>
                </div>
            </div>
        </div>
    </section>
    <?php }?>

    <!-- 游戏特色 -->
    <?php if(isset($t['features']) && !empty($t['features']) && isset($t['features']['items']) && !empty($t['features']['items'])){?>
    <section id="features" class="py-16 bg-white">
        <div class="container mx-auto px-4">
            <div class="text-center max-w-2xl mx-auto mb-16">
                <?php if(isset($t['features']['pretitle'])){?>
                <p class="text-primary font-medium mb-3"><?php echo $t['features']['pretitle']; ?></p>
                <?php }?>
                
                <?php if(isset($t['features']['title'])){?>
                <h2 class="text-[clamp(1.5rem,4vw,2.5rem)] font-display font-bold mb-6"><?php echo $t['features']['title']; ?></h2>
                <?php }?>
                
                <?php if(isset($t['features']['subtitle'])){?>
                <p class="text-dark/70"><?php echo $t['features']['subtitle']; ?></p>
                <?php }?>
            </div>
            
            <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8">
                <?php foreach ($t['features']['items'] as $item): ?>
                    <div class="bg-light border border-gray-100 rounded-xl p-8 card-hover">
                        <div class="w-14 h-14 rounded-full bg-primary/10 flex items-center justify-center mb-6">
                            <i class="fa <?php echo isset($item['icon']) ? $item['icon'] : ''; ?> text-2xl text-primary"></i>
                        </div>
                        <h3 class="text-xl font-bold mb-4 text-dark"><?php echo isset($item['title']) ? $item['title'] : ''; ?></h3>
                        <p class="text-dark/70"><?php echo isset($item['desc']) ? $item['desc'] : ''; ?></p>
                    </div>
                <?php endforeach; ?>
            </div>
        </div>
    </section>
    <?php }?>

    <!-- 英雄展示 -->
    <?php if(isset($t['characters']) && !empty($t['characters']) && isset($t['characters']['items']) && !empty($t['characters']['items'])){?>
    <section id="characters" class="py-16 bg-gray-50">
        <div class="container mx-auto px-4">
            <div class="text-center max-w-2xl mx-auto mb-16">
                <?php if(isset($t['characters']['pretitle'])){?>
                <p class="text-primary font-medium mb-3"><?php echo $t['characters']['pretitle']; ?></p>
                <?php }?>
                
                <?php if(isset($t['characters']['title'])){?>
                <h2 class="text-[clamp(1.5rem,4vw,2.5rem)] font-display font-bold mb-6"><?php echo $t['characters']['title']; ?></h2>
                <?php }?>
                
                <?php if(isset($t['characters']['subtitle'])){?>
                <p class="text-dark/70"><?php echo $t['characters']['subtitle']; ?></p>
                <?php }?>
            </div>
            
            <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 gap-6">
                <?php foreach ($t['characters']['items'] as $character): ?>
                    <div class="group relative overflow-hidden rounded-xl card-hover bg-white shadow-sm">
                        <img src="<?php echo isset($character['image']) ? $character['image'] : ''; ?>" alt="<?php echo isset($character['alt']) ? $character['alt'] : ''; ?>" class="w-full h-72 object-cover transition-transform duration-700 group-hover:scale-105">
                        <div class="absolute inset-0 bg-gradient-to-t from-dark/70 via-dark/30 to-transparent"></div>
                        <div class="absolute bottom-0 left-0 right-0 p-5">
                            <span class="text-xs text-white/80 mb-1 block"><?php echo isset($character['class']) ? $character['class'] : ''; ?></span>
                            <h3 class="text-xl font-bold text-white mb-2"><?php echo isset($character['name']) ? $character['name'] : ''; ?></h3>
                            <p class="text-white/70 text-sm opacity-0 group-hover:opacity-100 transition-opacity duration-300">
                                <?php echo isset($character['desc']) ? $character['desc'] : ''; ?>
                            </p>
                        </div>
                    </div>
                <?php endforeach; ?>
            </div>
            
            <?php if(isset($t['characters']['moreLink'])){?>
            <div class="text-center mt-12">
                <a href="#" class="inline-flex items-center text-primary hover:text-primary/80 font-medium transition-colors">
                    <span><?php echo $t['characters']['moreLink']; ?></span>
                    <i class="fa fa-arrow-right ml-2"></i>
                </a>
            </div>
            <?php }?>
        </div>
    </section>
    <?php }?>

    <!-- 皮肤展示 -->
    <?php if(isset($t['screenshots']) && !empty($t['screenshots']) && isset($t['screenshots']['items']) && !empty($t['screenshots']['items'])){?>
    <section id="skins" class="py-16 bg-white">
        <div class="container mx-auto px-4">
            <div class="text-center max-w-2xl mx-auto mb-16">
                <?php if(isset($t['screenshots']['pretitle'])){?>
                <p class="text-primary font-medium mb-3"><?php echo $t['screenshots']['pretitle']; ?></p>
                <?php }?>
                
                <?php if(isset($t['screenshots']['title'])){?>
                <h2 class="text-[clamp(1.5rem,4vw,2.5rem)] font-display font-bold mb-6"><?php echo $t['screenshots']['title']; ?></h2>
                <?php }?>
                
                <?php if(isset($t['screenshots']['subtitle'])){?>
                <p class="text-dark/70"><?php echo $t['screenshots']['subtitle']; ?></p>
                <?php }?>
            </div>
            
            <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
                <?php foreach ($t['screenshots']['items'] as $skin): ?>
                    <div class="relative overflow-hidden rounded-xl group card-hover">
                        <img src="<?php echo isset($skin['image']) ? $skin['image'] : ''; ?>" alt="<?php echo isset($skin['alt']) ? $skin['alt'] : ''; ?>" class="w-full h-60 object-cover transition-transform duration-700 group-hover:scale-105">
                        <div class="absolute inset-0 bg-gradient-to-t from-dark/40 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300"></div>
                    </div>
                <?php endforeach; ?>
            </div>
            
            <?php if(isset($t['screenshots']['moreLink'])){?>
            <div class="text-center mt-12">
                <a href="#" class="inline-flex items-center text-primary hover:text-primary/80 font-medium transition-colors">
                    <span><?php echo $t['screenshots']['moreLink']; ?></span>
                    <i class="fa fa-arrow-right ml-2"></i>
                </a>
            </div>
            <?php }?>
        </div>
    </section>
    <?php }?>

    <!-- 赛事部分 -->
    <?php if(isset($t['tournaments']) && !empty($t['tournaments'])){?>
    <section id="tournaments" class="py-16 bg-gray-50">
        <div class="container mx-auto px-4">
            <div class="text-center max-w-2xl mx-auto mb-16">
                <?php if(isset($t['tournaments']['pretitle'])){?>
                <p class="text-primary font-medium mb-3"><?php echo $t['tournaments']['pretitle']; ?></p>
                <?php }?>
                
                <?php if(isset($t['tournaments']['title'])){?>
                <h2 class="text-[clamp(1.5rem,4vw,2.5rem)] font-display font-bold mb-6"><?php echo $t['tournaments']['title']; ?></h2>
                <?php }?>
                
                <?php if(isset($t['tournaments']['subtitle'])){?>
                <p class="text-dark/70"><?php echo $t['tournaments']['subtitle']; ?></p>
                <?php }?>
            </div>
            
            <div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
                <!-- 主要赛事 -->
                <?php if(isset($t['tournaments']['current']) && !empty($t['tournaments']['current'])){?>
                <div class="lg:col-span-2">
                    <div class="bg-white rounded-xl overflow-hidden shadow-sm card-hover h-full">
                        <div class="relative">
                            <img src="<?php echo isset($t['tournaments']['current']['image']) ? $t['tournaments']['current']['image'] : ''; ?>" alt="<?php echo isset($t['tournaments']['current']['alt']) ? $t['tournaments']['current']['alt'] : ''; ?>" class="w-full h-64 object-cover">
                            <div class="absolute inset-0 bg-gradient-to-t from-dark/70 to-transparent"></div>
                            <div class="absolute bottom-0 left-0 p-6">
                                <h3 class="text-2xl font-bold text-white mb-2"><?php echo isset($t['tournaments']['current']['title']) ? $t['tournaments']['current']['title'] : ''; ?></h3>
                                <p class="text-white/80 mb-4"><?php echo isset($t['tournaments']['current']['date']) ? $t['tournaments']['current']['date'] : ''; ?></p>
                                <a href="#" class="inline-block px-5 py-2 bg-primary text-white rounded-full text-sm font-medium">
                                    <?php echo isset($t['tournaments']['current']['cta']) ? $t['tournaments']['current']['cta'] : ''; ?>
                                </a>
                            </div>
                        </div>
                        <div class="p-6 grid grid-cols-2 gap-4">
                            <div class="flex items-center">
                                <i class="fa fa-trophy text-accent mr-3 text-xl"></i>
                                <span><?php echo isset($t['tournaments']['current']['prize']) ? $t['tournaments']['current']['prize'] : ''; ?></span>
                            </div>
                            <div class="flex items-center">
                                <i class="fa fa-users text-primary mr-3"></i>
                                <span><?php echo isset($t['tournaments']['current']['teams']) ? $t['tournaments']['current']['teams'] : ''; ?></span>
                            </div>
                        </div>
                    </div>
                </div>
                <?php }?>
                
                <!-- 即将到来的赛事 -->
                <?php if(isset($t['tournaments']['upcoming']) && !empty($t['tournaments']['upcoming'])){?>
                <div class="bg-white rounded-xl shadow-sm p-6 card-hover">
                    <h3 class="text-xl font-bold mb-6 text-dark">即将到来的赛事</h3>
                    <div class="space-y-6">
                        <?php foreach ($t['tournaments']['upcoming'] as $tournament): ?>
                            <div class="flex justify-between items-center pb-6 border-b border-gray-100 last:border-0 last:pb-0">
                                <div>
                                    <h4 class="font-bold text-dark"><?php echo isset($tournament['name']) ? $tournament['name'] : ''; ?></h4>
                                    <p class="text-dark/60 text-sm mt-1"><?php echo isset($tournament['date']) ? $tournament['date'] : ''; ?></p>
                                </div>
                                <i class="fa fa-arrow-right text-primary"></i>
                            </div>
                        <?php endforeach; ?>
                    </div>
                    
                    <?php if(isset($t['tournaments']['moreLink'])){?>
                    <div class="mt-8">
                        <a href="#" class="inline-flex items-center text-primary hover:text-primary/80 font-medium transition-colors">
                            <span><?php echo $t['tournaments']['moreLink']; ?></span>
                            <i class="fa fa-arrow-right ml-2"></i>
                        </a>
                    </div>
                    <?php }?>
                </div>
                <?php }?>
            </div>
        </div>
    </section>
    <?php }?>

    <!-- 游戏资讯 -->
    <?php if(isset($t['news']) && !empty($t['news']) && isset($t['news']['items']) && !empty($t['news']['items'])){?>
    <section id="news" class="py-16 bg-white">
        <div class="container mx-auto px-4">
            <div class="text-center max-w-2xl mx-auto mb-16">
                <?php if(isset($t['news']['pretitle'])){?>
                <p class="text-primary font-medium mb-3"><?php echo $t['news']['pretitle']; ?></p>
                <?php }?>
                
                <?php if(isset($t['news']['title'])){?>
                <h2 class="text-[clamp(1.5rem,4vw,2.5rem)] font-display font-bold mb-6"><?php echo $t['news']['title']; ?></h2>
                <?php }?>
                
                <?php if(isset($t['news']['subtitle'])){?>
                <p class="text-dark/70"><?php echo $t['news']['subtitle']; ?></p>
                <?php }?>
            </div>
            
            <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
                <?php foreach ($t['news']['items'] as $item): ?>
                    <article class="bg-light rounded-xl overflow-hidden shadow-sm card-hover">
                        <div class="relative h-48 overflow-hidden">
                            <img src="<?php echo isset($item['image']) ? $item['image'] : ''; ?>" alt="<?php echo isset($item['title']) ? $item['title'] : ''; ?>" class="w-full h-full object-cover transition-transform duration-500 hover:scale-110">
                            <div class="absolute top-4 left-4 bg-primary/90 text-white text-xs px-3 py-1 rounded-full">
                                <?php echo isset($item['category']) ? $item['category'] : ''; ?>
                            </div>
                        </div>
                        <div class="p-6">
                            <p class="text-dark/60 text-sm mb-3"><?php echo isset($item['date']) ? $item['date'] : ''; ?></p>
                            <h3 class="text-xl font-bold mb-4 text-dark"><?php echo isset($item['title']) ? $item['title'] : ''; ?></h3>
                            <p class="text-dark/70 mb-6"><?php echo isset($item['desc']) ? $item['desc'] : ''; ?></p>
                            <a href="#" class="inline-flex items-center text-primary hover:text-primary/80 font-medium transition-colors">
                                <span><?php echo isset($t['readMore']) ? $t['readMore'] : '查看详情'; ?></span>
                                <i class="fa fa-arrow-right ml-2"></i>
                            </a>
                        </div>
                    </article>
                <?php endforeach; ?>
            </div>
            
            <?php if(isset($t['news']['moreLink'])){?>
            <div class="text-center mt-12">
                <a href="#" class="inline-flex items-center text-primary hover:text-primary/80 font-medium transition-colors">
                    <span><?php echo $t['news']['moreLink']; ?></span>
                    <i class="fa fa-arrow-right ml-2"></i>
                </a>
            </div>
            <?php }?>
        </div>
    </section>
    <?php }?>

    <!-- 下载部分 -->
    <?php if(isset($t['download']) && !empty($t['download'])){?>
    <section id="download" class="py-16 bg-gradient-to-br from-primary/5 to-secondary/5">
        <div class="container mx-auto px-4">
            <div class="text-center max-w-2xl mx-auto mb-16">
                <?php if(isset($t['download']['pretitle'])){?>
                <p class="text-primary font-medium mb-3"><?php echo $t['download']['pretitle']; ?></p>
                <?php }?>
                
                <?php if(isset($t['download']['title'])){?>
                <h2 class="text-[clamp(1.5rem,4vw,2.5rem)] font-display font-bold mb-6"><?php echo $t['download']['title']; ?></h2>
                <?php }?>
                
                <?php if(isset($t['download']['subtitle'])){?>
                <p class="text-dark/70"><?php echo $t['download']['subtitle']; ?></p>
                <?php }?>
            </div>
            
            <div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
                <!-- 下载按钮 -->
                <?php if(isset($t['download']['clients']) && !empty($t['download']['clients'])){?>
                <div class="lg:col-span-1">
                    <div class="bg-white rounded-xl p-8 shadow-sm h-full card-hover">
                        <h3 class="text-xl font-bold mb-6 text-dark">下载游戏</h3>
                        
                        <div class="space-y-6">
                            <?php foreach ($t['download']['clients'] as $client): ?>
                                <div class="border border-gray-100 rounded-lg p-5">
                                    <div class="flex items-center mb-4">
                                        <div class="w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center mr-4">
                                            <i class="fa <?php echo isset($client['icon']) ? $client['icon'] : ''; ?> text-2xl text-primary"></i>
                                        </div>
                                        <div>
                                            <h4 class="font-bold text-dark"><?php echo isset($client['os']) ? $client['os'] : ''; ?></h4>
                                            <p class="text-dark/60 text-sm"><?php echo isset($client['size']) ? $client['size'] : ''; ?></p>
                                        </div>
                                    </div>
                                    
                                    <div class="flex flex-col space-y-3">
                                        <a href="<?php echo isset($client['downloadLink']) ? $client['downloadLink'] : '#'; ?>" class="text-center py-3 bg-primary text-white rounded-lg font-medium hover:bg-primary/90 transition-colors">
                                            <?php echo isset($client['buttonText']) ? $client['buttonText'] : ''; ?>
                                        </a>
                                        
                                        <?php if (isset($client['secondButton'])): ?>
                                            <a href="<?php echo isset($client['secondButton']['link']) ? $client['secondButton']['link'] : '#'; ?>" class="text-center py-3 bg-white border border-gray-200 text-dark rounded-lg font-medium hover:bg-gray-50 transition-colors">
                                                <?php echo isset($client['secondButton']['text']) ? $client['secondButton']['text'] : ''; ?>
                                            </a>
                                        <?php endif; ?>
                                    </div>
                                </div>
                            <?php endforeach; ?>
                        </div>
                        
                        <?php if(isset($t['download']['notes']) && !empty($t['download']['notes'])){?>
                        <div class="mt-8 pt-6 border-t border-gray-100">
                            <h4 class="font-bold mb-4 text-dark">注意事项</h4>
                            <ul class="space-y-3">
                                <?php foreach ($t['download']['notes'] as $note): ?>
                                    <li class="flex items-start">
                                        <i class="fa fa-info-circle text-primary mt-1 mr-3"></i>
                                        <span class="text-dark/70"><?php echo $note; ?></span>
                                    </li>
                                <?php endforeach; ?>
                            </ul>
                        </div>
                        <?php }?>
                    </div>
                </div>
                <?php }?>
                
                <!-- 配置要求 -->
                <?php if(isset($t['download']['requirements']) && !empty($t['download']['requirements'])){?>
                <div class="lg:col-span-2">
                    <div class="bg-white rounded-xl p-8 shadow-sm card-hover h-full">
                        <h3 class="text-xl font-bold mb-6 text-dark">系统要求</h3>
                        
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-8">
                            <?php foreach ($t['download']['requirements'] as $reqType => $requirements): ?>
                                <div class="border border-gray-100 rounded-lg p-6">
                                    <h4 class="font-bold text-lg mb-5 text-dark flex items-center">
                                        <i class="fa <?php echo $reqType === 'minimum' ? 'fa-exclamation-circle text-orange-500' : 'fa-check-circle text-secondary'; ?> mr-3"></i>
                                        <?php echo isset($requirements['title']) ? $requirements['title'] : ''; ?>
                                    </h4>
                                    
                                    <ul class="space-y-4">
                                        <li class="flex items-start">
                                            <i class="fa fa-mobile text-primary mt-1 mr-3 text-xl"></i>
                                            <div>
                                                <span class="text-dark/60 text-sm">操作系统</span>
                                                <p class="font-medium"><?php echo isset($requirements['os']) ? $requirements['os'] : ''; ?></p>
                                            </div>
                                        </li>
                                        <li class="flex items-start">
                                            <i class="fa fa-microchip text-primary mt-1 mr-3"></i>
                                            <div>
                                                <span class="text-dark/60 text-sm">处理器</span>
                                                <p class="font-medium"><?php echo isset($requirements['processor']) ? $requirements['processor'] : ''; ?></p>
                                            </div>
                                        </li>
                                        <li class="flex items-start">
                                            <i class="fa fa-memory text-primary mt-1 mr-3"></i>
                                            <div>
                                                <span class="text-dark/60 text-sm">内存</span>
                                                <p class="font-medium"><?php echo isset($requirements['memory']) ? $requirements['memory'] : ''; ?></p>
                                            </div>
                                        </li>
                                        <li class="flex items-start">
                                            <i class="fa fa-hdd-o text-primary mt-1 mr-3"></i>
                                            <div>
                                                <span class="text-dark/60 text-sm">存储空间</span>
                                                <p class="font-medium"><?php echo isset($requirements['storage']) ? $requirements['storage'] : ''; ?></p>
                                            </div>
                                        </li>
                                        <li class="flex items-start">
                                            <i class="fa fa-wifi text-primary mt-1 mr-3"></i>
                                            <div>
                                                <span class="text-dark/60 text-sm">网络</span>
                                                <p class="font-medium"><?php echo isset($requirements['internet']) ? $requirements['internet'] : ''; ?></p>
                                            </div>
                                        </li>
                                    </ul>
                                </div>
                            <?php endforeach; ?>
                        </div>
                    </div>
                </div>
                <?php }?>
            </div>
        </div>
    </section>
    <?php }?>

    <!-- 社区部分 -->
    <?php if(isset($t['forum']) && !empty($t['forum']) && isset($t['forum']['topics']) && !empty($t['forum']['topics'])){?>
    <section id="community" class="py-16 bg-white">
        <div class="container mx-auto px-4">
            <div class="text-center max-w-2xl mx-auto mb-16">
                <?php if(isset($t['forum']['title'])){?>
                <h2 class="text-[clamp(1.5rem,4vw,2.5rem)] font-display font-bold mb-6"><?php echo $t['forum']['title']; ?></h2>
                <?php }?>
                
                <?php if(isset($t['forum']['subtitle'])){?>
                <p class="text-dark/70"><?php echo $t['forum']['subtitle']; ?></p>
                <?php }?>
            </div>
            
            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
                <?php foreach ($t['forum']['topics'] as $topic): ?>
                    <div class="bg-light rounded-xl p-6 shadow-sm card-hover">
                        <div class="flex justify-between items-start mb-4">
                            <h3 class="font-bold text-dark"><?php echo isset($topic['name']) ? $topic['name'] : ''; ?></h3>
                            <span class="bg-primary/10 text-primary text-xs px-2 py-1 rounded-full">
                                <?php echo isset($topic['count']) ? $topic['count'] : ''; ?>
                            </span>
                        </div>
                        <p class="text-dark/60 text-sm mb-4">最后更新: <?php echo isset($topic['lastPost']) ? $topic['lastPost'] : ''; ?></p>
                        <a href="#" class="text-primary hover:text-primary/80 text-sm font-medium inline-flex items-center">
                            <span>浏览主题</span>
                            <i class="fa fa-arrow-right ml-1"></i>
                        </a>
                    </div>
                <?php endforeach; ?>
            </div>
            
            <?php if(isset($t['forum']['cta'])){?>
            <div class="text-center mt-12">
                <a href="#" class="px-8 py-3 bg-primary hover:bg-primary/90 text-white rounded-full font-medium transition-all duration-300 shadow-md hover:shadow-lg inline-flex items-center">
                    <span><?php echo $t['forum']['cta']; ?></span>
                    <i class="fa fa-comments ml-2"></i>
                </a>
            </div>
            <?php }?>
        </div>
    </section>
    <?php }?>

    <!-- 页脚 -->
    <?php if(isset($t['footer']) && !empty($t['footer'])){?>
    <footer class="bg-gray-50 pt-16 pb-8">
        <div class="container mx-auto px-4">
            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-12 mb-12">
                <!-- 品牌介绍 -->
                <div class="lg:col-span-1">
                    <div class="flex items-center mb-6">
                        <div class="w-10 h-10 rounded-full bg-primary/10 flex items-center justify-center mr-3">
                            <span class="font-display text-primary text-xl font-bold">王</span>
                        </div>
                        <h2 class="text-2xl font-display text-dark">王者荣耀</h2>
                    </div>
                    
                    <?php if(isset($t['footer']['description'])){?>
                    <p class="text-dark/70 mb-6">
                        <?php echo $t['footer']['description']; ?>
                    </p>
                    <?php }?>
                    
                    <!-- 订阅 -->
                    <?php if(isset($t['footer']['subscribe'])){?>
                    <div>
                        <h3 class="font-bold text-dark mb-3"><?php echo $t['footer']['subscribe']; ?></h3>
                        <?php if(isset($t['footer']['subscribeDesc'])){?>
                        <p class="text-dark/60 text-sm mb-4"><?php echo $t['footer']['subscribeDesc']; ?></p>
                        <?php }?>
                        <form class="mb-3">
                            <div class="flex">
                                <input type="email" placeholder="<?php echo isset($t['footer']['subscribePlaceholder']) ? $t['footer']['subscribePlaceholder'] : ''; ?>" class="flex-1 px-4 py-3 rounded-l-lg border border-gray-200 focus:outline-none focus:border-primary">
                                <button type="submit" class="bg-primary text-white px-4 rounded-r-lg hover:bg-primary/90 transition-colors">
                                    <i class="fa fa-paper-plane"></i>
                                </button>
                            </div>
                        </form>
                        <?php if(isset($t['footer']['privacyNote'])){?>
                        <p class="text-dark/50 text-xs"><?php echo $t['footer']['privacyNote']; ?></p>
                        <?php }?>
                    </div>
                    <?php }?>
                </div>
                
                <!-- 链接 -->
                <?php if(isset($t['footer']['links']) && !empty($t['footer']['links'])){?>
                <div class="lg:col-span-3 grid grid-cols-1 sm:grid-cols-2 gap-8">
                    <?php foreach ($t['footer']['links'] as $linkGroup): ?>
                        <div>
                            <h3 class="font-bold text-dark mb-6"><?php echo isset($linkGroup['title']) ? $linkGroup['title'] : ''; ?></h3>
                            <ul class="space-y-4">
                                <?php foreach ($linkGroup['items'] as $item): ?>
                                    <li>
                                        <a href="<?php echo isset($item['link']) ? $item['link'] : '#'; ?>" class="text-dark/70 hover:text-primary transition-colors">
                                            <?php echo isset($item['name']) ? $item['name'] : ''; ?>
                                        </a>
                                    </li>
                                <?php endforeach; ?>
                            </ul>
                        </div>
                    <?php endforeach; ?>
                </div>
                <?php }?>
            </div>
            
            <!-- 法律链接 -->
            <div class="border-t border-gray-200 pt-8 pb-6">
                <?php if(isset($t['footer']['legalLinks']) && !empty($t['footer']['legalLinks'])){?>
                <div class="flex flex-wrap justify-center gap-4 md:gap-8 mb-6">
                    <?php foreach ($t['footer']['legalLinks'] as $link): ?>
                        <a href="<?php echo isset($link['link']) ? $link['link'] : '#'; ?>" class="text-dark/60 hover:text-primary text-sm transition-colors">
                            <?php echo isset($link['name']) ? $link['name'] : ''; ?>
                        </a>
                    <?php endforeach; ?>
                </div>
                <?php }?>
                
                <!-- 版权信息 -->
                <?php if(isset($t['footer']['copyright'])){?>
                <p class="text-center text-dark/50 text-sm">
                    <?php echo $t['footer']['copyright']; ?>
                </p>
                <?php }?>
            </div>
        </div>
    </footer>
    <?php }?>

    <!-- JavaScript 交互 -->
    <script>
        // 导航栏滚动效果
        window.addEventListener('scroll', function() {
            const navbar = document.getElementById('navbar');
            if (navbar && window.scrollY > 50) {
                navbar.classList.add('shadow-md');
                navbar.classList.remove('shadow-sm');
            } else if (navbar) {
                navbar.classList.remove('shadow-md');
                navbar.classList.add('shadow-sm');
            }
        });
        
        // 语言选择器
        const langToggle = document.getElementById('langToggle');
        const langDropdown = document.getElementById('langDropdown');
        
        if (langToggle && langDropdown) {
            langToggle.addEventListener('click', function() {
                langDropdown.classList.toggle('hidden');
            });
            
            // 点击外部关闭下拉菜单
            document.addEventListener('click', function(event) {
                if (!langToggle.contains(event.target) && !langDropdown.contains(event.target)) {
                    langDropdown.classList.add('hidden');
                }
            });
        }
        
        // 移动端菜单
        const mobileMenuBtn = document.getElementById('mobileMenuBtn');
        const closeMenuBtn = document.getElementById('closeMenuBtn');
        const mobileMenu = document.getElementById('mobileMenu');
        
        if (mobileMenuBtn && closeMenuBtn && mobileMenu) {
            mobileMenuBtn.addEventListener('click', function() {
                mobileMenu.classList.remove('translate-x-full');
            });
            
            closeMenuBtn.addEventListener('click', function() {
                mobileMenu.classList.add('translate-x-full');
            });
            
            // 点击菜单链接后关闭菜单
            const mobileLinks = mobileMenu.querySelectorAll('a');
            mobileLinks.forEach(link => {
                link.addEventListener('click', function() {
                    mobileMenu.classList.add('translate-x-full');
                });
            });
        }
        
        // 平滑滚动
        document.querySelectorAll('a[href^="#"]').forEach(anchor => {
            anchor.addEventListener('click', function (e) {
                e.preventDefault();
                
                const targetId = this.getAttribute('href');
                if (targetId === '#') return;
                
                const targetElement = document.querySelector(targetId);
                if (targetElement) {
                    window.scrollTo({
                        top: targetElement.offsetTop - 80,
                        behavior: 'smooth'
                    });
                }
            });
        });
    </script>
</body>
</html>
    